import { useEffect, useState } from "react";
import { Props } from "./types";

const Svg = (props: Props) => {
  const [size, setSize] = useState(16);
  const [color, setColor] = useState("#FFFFFF");
  useEffect(() => {
    if (props.size) {
      setSize(props.size);
    }
    if (props.color) {
      setColor(props.color);
    }
  }, [props.color, props.size]);
  return (
    <svg
      viewBox="0 0 1024 1024"
      version="1.1"
      xmlns="http://www.w3.org/2000/svg"
      p-id="6029"
      width={size}
      height={size}
      style={props.style}
    >
      <path
        d="M444.416 256l256 256-256 256L384 707.584 580.608 512 384 316.416z"
        fill={color}
        p-id="6030"
      ></path>
    </svg>
  );
};

export default Svg;
